
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html class="ie6 settings-main_background" lang="zh"> <![endif]-->
<!--[if IE 7 ]> <html class="ie7 settings-main_background" lang="zh"> <![endif]-->
<!--[if IE 8 ]> <html class="ie8 settings-main_background" lang="zh"> <![endif]-->
<!--[if IE 9 ]> <html class="ie9 settings-main_background" lang="zh"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html class="settings-main_background" lang="zh"><!--<![endif]-->
<head>
    <meta charset="utf-8">
    <link rel="dns-prefetch" href="//asset.ibanquan.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>文章详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="文章详情">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
    <link rel="shortcut icon" href="__STATIC__/home/index/picture/2.png" type="image/x-icon">
    <link href='__STATIC__/home/index/css/base-160225.min_5.css' media='screen' rel='stylesheet' type='text/css' />
    <link href='__STATIC__/home/index/css/iconfont_5.css' media='screen' rel='stylesheet' type='text/css' />
    <link href='__STATIC__/home/index/css/iconfont-1_5.css' media='screen' rel='stylesheet' type='text/css' />
    <link href='__STATIC__/home/index/css/main_5.css' media='screen' rel='stylesheet' type='text/css' />
    <link href='__STATIC__/home/index/css/user_5.css' media='screen' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="__STATIC__/admin/js/layui/css/layui.css">
    <script src='__STATIC__/home/index/js/jquery-1.11.3.min_4.js' type='text/javascript'></script>
    <script src='__STATIC__/home/index/js/jssdk-0.0.18.min_4.js' type='text/javascript'></script>
    <script src='__STATIC__/home/index/js/lazyload.min_5.js' type='text/javascript'></script>

    <script>(function(){var yt = document.createElement('script');yt.src = '//asset.ibanquan.com/common/js/tracker-0.0.2.min.js?v=142';var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(yt, s);})();</script>
</head>
<body >

<!--导航-->
<div class="head container settings-top_background">
    <div class="head-t">
        <div class="head-btn settings-top_color">
            <i class="iconfont icon-hanbao" id="nav_mobile"></i>
        </div>
        <div class="head-tl">
            <a href="{:url('home/index/index')}">
                <img src="__STATIC__/home/index/picture/456.png" alt="创学习">
            </a>
        </div>

        <div class="head-tr">
            <div id="navline" style=""></div>
            <ul class="dropdown-list">


                <li class="dropdown-list-item">
                    <a class="dropdown-link settings-nav_text_color"
                       href="{:url('home/index/index')}"

                    >
                        首页
                    </a>
                </li>


                <li class="dropdown-list-item">
                    <a class="dropdown-link settings-nav_text_color"
                       href="{:url('home/courses/index')}"

                    >
                        课程
                    </a>
                </li>


                <li class="dropdown-list-item">
                    <a class="dropdown-link settings-nav_text_color"
                       href="{:url('home/article/index')}"

                    >
                        文章
                    </a>
                </li>


                <li class="dropdown-list-item">
                    {if condition="$user_id gt 0"}
                    <a class="dropdown-link settings-nav_text_color"
                       href="{:url('home/users/index')}">个人中心
                    </a>
                    {else /}
                    <a class="dropdown-link settings-nav_text_color"
                       href="{:url('home/users/login')}">登录注册
                    </a>
                    {/if}

                </li>

                <li class="dropdown-list-item">
                    <a class="dropdown-link settings-nav_text_color"
                       href="{:url('home/index/contact')}"
                    >
                        联系我们
                    </a>
                </li>
                {if condition="$user_id gt 0"}
                <li class="dropdown-list-item">
                    <a class=" del dropdown-link settings-nav_text_color"
                    >
                        退出
                    </a>
                </li>
                {/if}
            </ul>
        </div>

    </div>
</div>
<!--手机导航-->
<div class="container wrapper-mobile_nav" id="mobile_menu">
    <div class="mobile_nav">
        <!-- -->
        <div class="mobile_nav_menu settings-mobi_nav_background">
            <div class="mobile_nav_top settings-top_color settings-main_border">
                <a href="{:url('home/index/index')}">
                    <img src="__STATIC__/home/index/picture/456.png" alt="创学习">
                </a>
                <i class="iconfont icon-close" id="closeMbileNav"></i>
            </div>
            <!-- 一级菜单 -->
            <ul id="side-nav-link" class="side-nav-link">



                <li class="side-nav-link-each">
                    <a class="settings-nav_text_color settings-sideLinkHover_color"
                       href="{:url('home/index/index')}"

                    >
                        首页
                    </a>
                </li>


                <li class="side-nav-link-each">
                    <a class="settings-nav_text_color settings-sideLinkHover_color"
                       href="{:url('home/courses/index')}"

                    >
                        课程
                    </a>
                </li>


                <li class="side-nav-link-each">
                    <a class="settings-nav_text_color settings-sideLinkHover_color"
                       href="{:url('home/article/index')}"

                    >
                        文章
                    </a>
                </li>


                <li class="side-nav-link-each">
                    {if condition="$user_id gt 0"}

                    <a class="settings-nav_text_color settings-sideLinkHover_color"
                       href="{:url('home/index/index')}">
                        个人中心
                    </a>
                    {else /}
                    <a class="settings-nav_text_color settings-sideLinkHover_color"
                       href="{:url('home/users/login')}">
                        登录注册
                    </a>
                    {/if}

                </li>

                <li class="side-nav-link-each">
                    <a class="settings-nav_text_color settings-sideLinkHover_color"
                       href="{:url('home/index/contact')}"

                    >
                        联系我们
                    </a>
                </li>
                {if condition="$user_id  gt 0"}
                <li class="side-nav-link-each">
                    <a class="del settings-nav_text_color settings-sideLinkHover_color" >
                        退出
                    </a>
                </li>
                {/if}
                <!---->
            </ul>
        </div>
        <div class="mobile_nav_bg" id="mobile_bg"></div>
        <!-- -->
    </div>
</div>




<div class="container settings-main_background_color">
    <div class="breadcrumb settings-main_text_color txt-overflow">
        <div class="breadcrumb-content">
            <a class="settings-main_text_color" href="{:url('home/index/index')}" title="首页">首页</a><span class="breadcrumb-split">&nbsp;&nbsp;&nbsp;&gt;&nbsp;</span>
            <a class="settings-main_text_color" href="{:url('home/article/index')}" title="所有文章">新添文章</a><span class="breadcrumb-split">&nbsp;&nbsp;&nbsp;&gt;&nbsp;</span><span class="breadcrumb-current settings-link_color"></span>
        </div>
    </div>
</div>

<div class="container settings-main_background_color page-detail">
    <div class="post-wrapper">
        <div class="post-cont">
            <div class="post">
                <h2 class="post-title main_header_color">
                </h2>
                <form id="form" method="post"  class="layui-form" action="" enctype="multipart/form-data">
                <div class="post-info settings-main_desc_color">
                    <span class="post-info-publish_at">
                        标题：<input type="text" class="article_title" name="article_title" value="" style="width: auto;height: 30px"></span>
                </div>
                <div class="post-content settings-main_text_color">
                     <p class="p1">
                          <!--<textarea id="content" class="article_content" name="article_content" style=" width: 99%; height: 300px; visibility: hidden; display: block; ">-->
                    <!--</textarea>-->


                         <textarea class="layui-textarea " id="LAY_demo1" style="display: none" >
  在这里输入内容...
</textarea>



                    <!--<textarea name="" required lay-verify="required" placeholder="请输入" class="layui-textarea"></textarea>-->

                         <!--<span style="color:#CC6600">敏感词：</span><font color='red' id="show_word"></font>-->
                     </p>
                    <input type="file" value="图片"  name="photo" onchange="fuck()"/>
                    <input type="hidden" name="photos" value="" class="hidd">
                    <img src="" id="img"/>

                     <select name="catname" class="catname" >
                         {volist name='catname' id='vo'}
                         <option value="{$vo.id}">{$vo.catname}</option>
                         {/volist}
                     </select>

                     <p class="p">
                        <input type="button"  class="btn" data-type="content" value="发布"></p>
                    <!--<p class="p1" style="margin: 0px 0px 1em; padding: 0px; color: #1a1a1a; font-family: 'Yu Gothic', YuGothic, 'Hiragino Kaku Gothic Pro', Meiryo, verdana, Osaka, 'MS PGothic', sans-serif; font-size: 16px;"><img src="__STATIC__/home/index/picture/s_2.jpeg" style="display: block; margin-left: auto; margin-right: auto;" /><br /></span></p>-->
                </div>
                </form>
            </div>

        </div>
    </div>
</div>
<div id='tracecode'></div>
<!--尾部-->
<div class="footer container settings-footer_background">
    <div class="footer-content">
        <div class="footer-t">
            <div class="footer-t-l">
                <div class="footer-nav">

                    <a class="footer-link settings-footer_text_color" href="https://youhaosuda.com/" >关于我们</a>

                    <span class="footer-split settings-footer_text_color">|</span>


                    <a class="footer-link settings-footer_text_color" href="https://youhaosuda.com/" >友情链接</a>

                    <span class="footer-split settings-footer_text_color">|</span>


                    <a class="footer-link settings-footer_text_color" href="/posts?dir_id=15730" >更多文章</a>

                    <span class="footer-split settings-footer_text_color">|</span>


                    <a class="footer-link settings-footer_text_color" href="/pages/g000001" >最新动态</a>


                </div>
            </div>
        </div>
        <div class="footer-b settings-footer_text_color">
            © 2017 youhaosuda.com All rights reserved.Powered by Youhaosuda.
        </div>
    </div>
</div>

<script src='__STATIC__/home/index/js/main_5.js' type='text/javascript'></script>
<script src='__STATIC__/home/index/js/user_5.js' type='text/javascript'></script>
<script src="__STATIC__/home/js/layer/layer.js"></script>
<script src="__STATIC__/admin/js/layui/layui.js"></script>

<script>


    layui.use('layedit', function(){
        var layedit = layui.layedit
            ,$ = layui.jquery;

        //构建一个默认的编辑器
        var index = layedit.build('LAY_demo1');

//编辑器外部操作
        var active = {
            content: function(){
              a = layedit.getText(index); //获取编辑器内容

            }
        };
        $('.btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
//
            var data= {};
            data.article_title=$(".article_title").val();
            data.article_content= a ;
            data.photos=$(".hidd").val();
            data.catname=$(".catname").val();
            console.dir(data);

            $.post("{:url('home/center/insert_articles')}",data,function (data) {

                console.log(data);


                if (data == 0){

                    layer.msg('发布成功', {icon: 1,time: 2000});

                    setTimeout(function(){
                        window.location.href = ("{:url('home/center/public_articles')}");
                    }, 2000);

                }else if(data==1){

                    layer.msg('发布失败', {icon: 2});
                }else if(data==2){
                    layer.msg('内容标题图片不能空！', {icon: 2});
                }
            })

        });

    });


</script>


<script>


    var contents = "{!! $data['article_content'] !!}";  //文章内容先存在变量contents中


                    if(data.code == 200){
                       var str = '';
                       $.each(data.data, function(i, e) {
                           if(contents.indexOf(e.word) > 0){
                               str += e.word+', ';
                               //若匹配到了铭感词使用高亮显示,这里使用的是红色显示
                               contents = contents.replace(new RegExp(e.word,"gm"), '<span style="color:red;">'+e.word+'</span>');
                               layer.msg('有敏感词！', {icon: 5});
                           }
                       });

                       $('#show_word').html(str);   //将匹配到的敏感词放到敏感词显示区域
                       $('#content').html(contents);    //将敏感词高亮后的文章放到文章显示区域
                   }

    function fuck() {
                var form=$('#form')[0];

                var obj=new FormData(form);
                console.dir(obj);
                $.ajax({
                    url:"{:url('home/center/upload')}",
                    method:"POST",
                    data:obj,
                    contentType:false,//文件上传必须
                    processData:false,//文件上传必须
                    success:function (data) {
                        var jost = JSON.parse( data );

                        var imgUrl = "__UPLOADS__/photo/"+jost;
                        $(".hidd").val(imgUrl);
                    }
                })

    }

</script>
<script>

    $(document).ready(function () {
        $(".del").click(function () {
            $.get("{:url('home/users/login_out')}", function (data) {

                console.debug(data);

                if(data == 1){
                    layer.msg('退出成功！！', {icon: 1});

                    setTimeout(function(){
                        window.location.href="{:url('home/index/index')}";
                    },500);

                }
            })
        })
    })
</script>
<script src="__STATIC__/home/js/jquery.min.js"></script>

</body>
</html>
